#ifndef WIDGET_H
#define WIDGET_H
#include <QUrl>
#include <QWidget>
#include <QListWidget>
#include <log.h>
#include <son.h>

class QMediaPlayer;
class QAudioOutput;
QT_BEGIN_NAMESPACE
namespace Ui {
class Widget;
}
QT_END_NAMESPACE

class Widget : public QWidget
{
    Q_OBJECT

public:
    Widget(QWidget *parent = nullptr);
    void paintEvent(QPaintEvent *event);
    Ui::Widget *ui;
    ~Widget();

private slots:
    void on_pushButton_3_clicked();
    void on_pushButton_clicked();
    void on_pushButton_5_clicked();
    void on_pushButton_4_clicked();
    void on_pushButton_2_clicked();
    void on_listWidget_itemDoubleClicked(QListWidgetItem *item);
    void on_horizontalSlider_actionTriggered(int action);
    void on_pushButton_6_clicked();
    void on_pushButton_7_clicked();
    void on_pushButton_9_clicked();
    void on_horizontalSlider_2_actionTriggered(int action);
    void on_pushButton_8_clicked();
    void on_pushButton_10_clicked();
    void on_pushButton_12_clicked();
    void on_pushButton_13_clicked();
    void toSon();
    void tolog();
    void sontoMain();
  //  void mousePressEvent(QMouseEvent *event);
    void logtoMain();
    void read_music_his(QString path);
    void ans_yes();
    void on_pushButton_14_clicked();

private:

    QList<QUrl> playlist;   //播放列表
    QMediaPlayer *player;
    QAudioOutput *audiooutput;
    int miao=0,fen=0;
    int fakeduration;
    qint64 duration;
    int button9_pushed=0;
    QString filename;
    bool is_list_hidden=false;
    son S;              //子窗口的实例化对象
    Log L;
};
#endif // WIDGET_H
